<template>
	<view>
		<u-top-tips ref="uTips" :navbar-height="0"></u-top-tips>
		<nav-box title="培训经历"><text class="add-experience" @click="addExperience">+新增经历</text></nav-box>
		<view class="content">
			<block v-for="item in list" :key="item.id">
				<navigator :url="`../experienceList/experienceList?type=${item.type}&title=${item.title}`" hover-class="none">
					<view class="experience-box">
						<text>{{item.title}}</text>
						<image src="../../static/images/forward.png" mode=""></image>
					</view>
				</navigator>
			</block>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			list: []
		};
	},
	onLoad() {
		this.list = [
			{
				id: 1,
				title: '参加的培训经历',
				type: 1
			},
			{
				id: 2,
				title: '承担的培训任务',
				type: 2
			}
		]
	},
	methods: {
		addExperience() {
			// 暂未开放 
			this.$refs.uTips.show({
				title: '新增经历功能暂未开放',
				type: 'error',
				icon: false
			});
			// 如果开放 就跳转到 addExperience页面
			// uni.navigateTo({
			// 	url: '../addExperience/addExperience'
			// })
		}
	}
};
</script>

<style lang="scss" scoped>
page {
	background-color: #ffffff;
	/deep/ .add-experience {
		font-size: 32upx;
		color: #6e6e6e;
	}
	.content {
		padding: 0 40upx;
		.experience-box {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 40upx 0;
			border-bottom: 2upx solid #f1f1f1;
			color: #4b4b4b;
			font-size: 32upx;
			image {
				width: 40upx;
				height: 40upx;
			}
		}
	}
}
</style>
